#ifndef __FUNCTIONSET_H__
#define __FUNCTIONSET_H__

#include <functional>
#include "BoundaryConditions.h"
#include "Vec.h"

template <int N>
using Function = std::function<Real(Vec<Real,N>)>;

#define ASSIGNFUNCTIONS(name, N)          \
    for (int i = 0; i < 2 * N; ++i, ++it) \
    {                                     \
        name[i] = *it;                    \
    }

template <int N>
struct FunctionSet
{
    FunctionSet(std::initializer_list<Function<N>> functions)
    {
        auto it = functions.begin();
        ASSIGNFUNCTIONS(Boundary, N)
        ASSIGNFUNCTIONS(g_partial, N)
        f = *(it++);
        u = *it;
    }
    Function<N> Boundary[2 * N], g_partial[2 * N];
    Function<N> f;
    Function<N> u;
};

#endif // __FUNCTIONSET_H__